package com.ruoyi.energize.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.energize.mapper.YancaoStoreDailySalesReportMapper;
import com.ruoyi.energize.domain.YancaoStoreDailySalesReport;
import com.ruoyi.energize.service.IYancaoStoreDailySalesReportService;

/**
 * 门店日销售报表Service业务层处理
 *
 * @author ruoyi
 * @date 2023-05-25
 */
@Service
public class YancaoStoreDailySalesReportServiceImpl implements IYancaoStoreDailySalesReportService
{
    @Autowired
    private YancaoStoreDailySalesReportMapper yancaoStoreDailySalesReportMapper;

    /**
     * 查询门店日销售报表
     *
     * @param id 门店日销售报表主键
     * @return 门店日销售报表
     */
    @Override
    public YancaoStoreDailySalesReport selectYancaoStoreDailySalesReportById(Long id)
    {
        return yancaoStoreDailySalesReportMapper.selectYancaoStoreDailySalesReportById(id);
    }

    /**
     * 查询门店日销售报表列表
     *
     * @param yancaoStoreDailySalesReport 门店日销售报表
     * @return 门店日销售报表
     */
    @Override
    public List<YancaoStoreDailySalesReport> selectYancaoStoreDailySalesReportList(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectYancaoStoreDailySalesReportList(yancaoStoreDailySalesReport);
    }

    @Override
    public List<YancaoStoreDailySalesReport> selectYancaoStoreDailySalesReportAvgListBydate(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectYancaoStoreDailySalesReportAvgListBydate(yancaoStoreDailySalesReport);
    }

    @Override
    public List<YancaoStoreDailySalesReport> selectWeekSalesAvgListByTime(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectWeekSalesAvgListByTime(yancaoStoreDailySalesReport);
    }

    @Override
    public List<YancaoStoreDailySalesReport> selectWeekUnitPriceAvgListByTime(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectWeekUnitPriceAvgListByTime(yancaoStoreDailySalesReport);
    }

    @Override
    public List<YancaoStoreDailySalesReport> selectWeekOrderNumAvgListByTime(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectWeekOrderNumAvgListByTime(yancaoStoreDailySalesReport);
    }

    @Override
    public List<YancaoStoreDailySalesReport> selectMonthSalesAvgListByTime(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectMonthSalesAvgListByTime(yancaoStoreDailySalesReport);
    }

    @Override
    public List<YancaoStoreDailySalesReport> selectStoreMonthListBydate(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectStoreMonthListBydate(yancaoStoreDailySalesReport);
    }

    @Override
    public List<YancaoStoreDailySalesReport> selectStoreSalesListBydate(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectStoreSalesListBydate(yancaoStoreDailySalesReport);
    }

    @Override
    public YancaoStoreDailySalesReport selectSumSalesBydate(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectSumSalesBydate(yancaoStoreDailySalesReport);
    }



    @Override
    public List<YancaoStoreDailySalesReport> selectYancaoStoreDailySalesReportListBydate(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        return yancaoStoreDailySalesReportMapper.selectYancaoStoreDailySalesReportListBydate(yancaoStoreDailySalesReport);
    }
    /**
     * 新增门店日销售报表
     *
     * @param yancaoStoreDailySalesReport 门店日销售报表
     * @return 结果
     */
    @DataSource(DataSourceType.MASTER)
    @Override
    public int insertYancaoStoreDailySalesReport(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        yancaoStoreDailySalesReport.setCreateTime(DateUtils.getNowDate());
        return yancaoStoreDailySalesReportMapper.insertYancaoStoreDailySalesReport(yancaoStoreDailySalesReport);
    }
    /**
     * 修改门店日销售报表
     *
     * @param yancaoStoreDailySalesReport 门店日销售报表
     * @return 结果
     */
    @Override
    public int updateYancaoStoreDailySalesReport(YancaoStoreDailySalesReport yancaoStoreDailySalesReport)
    {
        yancaoStoreDailySalesReport.setUpdateTime(DateUtils.getNowDate());
        return yancaoStoreDailySalesReportMapper.updateYancaoStoreDailySalesReport(yancaoStoreDailySalesReport);
    }

    /**
     * 批量删除门店日销售报表
     *
     * @param ids 需要删除的门店日销售报表主键
     * @return 结果
     */
    @Override
    public int deleteYancaoStoreDailySalesReportByIds(Long[] ids)
    {
        return yancaoStoreDailySalesReportMapper.deleteYancaoStoreDailySalesReportByIds(ids);
    }

    /**
     * 删除门店日销售报表信息
     *
     * @param id 门店日销售报表主键
     * @return 结果
     */
    @Override
    public int deleteYancaoStoreDailySalesReportById(Long id)
    {
        return yancaoStoreDailySalesReportMapper.deleteYancaoStoreDailySalesReportById(id);
    }
    @Override
    public List<YancaoStoreDailySalesReport> selectSyncKeLiuData(String yesterdayStr){
        return yancaoStoreDailySalesReportMapper.selectSyncKeLiuData(yesterdayStr);
    }
}
